﻿
@{
    ViewBag.Title = "Newjx";
    Layout = "~/Views/Shared/_LayoutHome.cshtml";
}
@section head{
    <link href="~/Content/home-newjx.css?@Tools.GetRandMax()" rel="stylesheet" />
}
@model Yyyg.WebUI.Models.NewJxVM
<div class="newjx">
    <div class="path-navs">
        <a href="/home/index">首页</a>
        <a href="javascript:void(0)">最新揭晓</a>
    </div>
    <div class="toptitle">
        <span class="big">最新揭晓</span>
        <span class="sm">(截止目前已揭晓<span class="number">@Model.DataNumbers</span>件商品)</span>
    </div>
    <div class="content">
        <div class="lef newjx-area">
          
        </div>
        <div class="rig">
            <div class="tm">
                <div class="tit">TA们正在云购</div>
                <ul class="rollist">
                    @for (int i = 0; i < Model.NewBys.Count; i++)
                    {
                        var item = Model.NewBys[i];
                        <li class="item" style="background-color:@(i%2==0?"white":"#eee")">
                            <div>
                                <img class="uhead headimg" src="@Server.MapUserHead(item.Uid)" />
                            </div>
                            <div class="blkfont">
                                <div>
                                    <a class="uname">@item.Member.Petname</a>
                                </div>
                                <div>
                                    <span>参与</span>
                                    <b class="rc">@(item.Bycount)人次&nbsp;</b>
                                    <a class="gdname goodlink" href="/home/goodabout?rhid=@(item.Rush_id)">@item.Rushby_all.Goods.Title</a>
                                </div>
                                <div>
                                    <span>剩余@(item.Rushby_all.Rem)人次</span>
                                </div>
                            </div>
                        </li>
                    }
                </ul>
            </div>
            <div class="hot">
                <div class="tit">人气排行</div>
                <ul class="hotlist">
                    @for (int i = 0; i < Model.HotList.Count; i++)
                    {
                        var item = Model.HotList[i];
                        <li>
                            <div class="lef">
                                <a href="/home/goodabout?rhid=@(item.Id)">
                                    <img src="@item.Goods.GetMainImgPath()" />
                                </a>
                            </div>
                            <div class="rig">
                                <div class="gdtitbx">
                                    <a class="goodlink" href="/home/goodabout?rhid=@item.Id">
                                        @item.Goods.Title
                                    </a>
                                </div>
                                <div class="gdrembx">
                                    <span class="tag">剩余人次</span>
                                    <span>@(item.Rem)人次</span>
                                </div>
                            </div>
                        </li>
                    }
                </ul>
            </div>
        </div>
    </div>
    <div style="text-align:center" id="pagebar" class="layui-pa"></div>
</div>
<script>
    $(function () {
        if ($(".newjx-area .jxitem").length % 2 != 0) {
            $(".newjx-area").append(`<div class="afterfill"></div>`)
        }

        layui.use("laypage", function () {
            var laypage = layui.laypage;
            //完整功能
            laypage.render({
                elem: 'pagebar',
                count: @(Model.DataNumbers),
                layout: ['count', 'prev', 'page', 'next', 'refresh', 'skip'],
                jump: function (obj) {
                    let pindex = obj.curr;
                    let psize = obj.limit;
                    $.post({
                        url: "/home/NewJxQueryPage",
                        data: {
                            pindex: pindex,
                            psize:psize
                        },
                        dataType: "html",
                        success:function(html) {
                            $(".content .newjx-area").html(html);
                        }
                    })
                }
            });
        });
    });
</script>
